pub fn find_max_prime_factor(mut number: u128) -> u128 {
    let mut max_factor = 1;
    let limit = 1_000_000; // 可根据需要调整范围
    let primes = sieve_of_eratosthenes(limit);

    // 用质数表分解小因子
    for p in primes {
        let p = p as u128;
        while number % p == 0 {
            max_factor = p;
            number /= p;
        }
        if p * p > number {
            break;
        }
    }

    // 如果剩余部分是一个大质数
    if number > 1 {
        max_factor = number;
    }

    max_factor
}
/// 埃拉托色尼筛法，生成给定范围内的所有质数
fn sieve_of_eratosthenes(limit: u64) -> Vec<u64> {
    let mut is_prime = vec![true; (limit + 1) as usize];
    let mut primes = Vec::new();

    for p in 2..=limit {
        if is_prime[p as usize] {
            primes.push(p);
            let mut multiple = p * p;
            while multiple <= limit {
                is_prime[multiple as usize] = false;
                multiple += p;
            }
        }
    }

    primes
}

